07. Quiz: Musical Groups (3-3)
Musical groups have special names based on the number of people in the group.
For example, a "quartet" is a musical group with four musicians. Barbershop quartets were a popular type of quartet in the early 1900s and featured four singers made up of a lead, tenor, baritone, and bass.
Directions:
Write a series of conditional statements that:
- Prints
"not a group"
ifmusicians
is less than or equal to0
- Prints
"solo"
ifmusicians
is equal to1
- Prints
"duet"
ifmusicians
is equal to2
- Prints
"trio"
ifmusicians
is equal to3
- Prints
"quartet"
ifmusicians
is equal to4
- Prints
"this is a large group"
ifmusicians
is greater than4
TIP: Test your code with different values. For example,
Ifmusicians
equals3
, then"trio"
should be printed to the console.
Ifmusicians
equals20
, then"this is a large group"
should be printed to the console.
Ifmusicians
equals-1
, then"not a group"
should be printed to the console.
Be sure to watch out for any extra or missing characters (including spaces or punctuation marks) in your output string as well!
Your Code:
Start Quiz:
/*
* Programming Quiz: Musical Groups (3-3)
*/
// change the value of `musicians` to test your conditional statements
var musicians = 1;
// your code goes here
INSTRUCTOR NOTE:
Have questions? Head to Knowledge for discussion with the Udacity Community.